package com.ty.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ty.entity.Carts;
import com.ty.mapper.CartsMapper;
import com.ty.service.ICartsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author txy
 * @since 2024-01-30
 */
@Service
public class CartsServiceImpl extends ServiceImpl<CartsMapper, Carts> implements ICartsService {

    @Override
    public Page<Carts> getCarts(Page<Carts> page, String userId) {
        QueryWrapper<Carts> wrapper = new QueryWrapper<>();
        wrapper.eq("user_id",userId);
        return baseMapper.selectCarts(page,wrapper);
    }
}
